package geppetto.decoder.scores;

import java.util.HashMap;

import geppetto.decoder.TranslationHypothesis;
import geppetto.decoder.TranslationHypothesisScore;
import geppetto.decoder.TranslationOption;

public class NumberOfOptionsScore implements TranslationHypothesisScore{

	HashMap<TranslationHypothesis, Integer> optionsForEachNode;
	
	@Override
	public void addOption(TranslationHypothesis baseHyp,
			TranslationHypothesis newHyp, TranslationOption option) {
		optionsForEachNode.put(newHyp, optionsForEachNode.get(baseHyp) + 1);
	}

	@Override
	public void init(TranslationHypothesis initialHypothesis) {
		optionsForEachNode = new HashMap<TranslationHypothesis, Integer>();
		optionsForEachNode.put(initialHypothesis, 0);
	}
	
	public int getNumberOfOptionsForHpy(TranslationHypothesis key){
		return optionsForEachNode.get(key);
	}
}
